import { S } from '../../s';
import { IPSAppDEAction } from '../dataentity/ipsapp-deaction';
import { IPSAppDEField } from '../dataentity/ipsapp-defield';
import { IPSAppDataEntity } from '../dataentity/ipsapp-data-entity';
import { IPSAppDynaUtilBase } from './ipsapp-dyna-util-base';
import { PSAppUtilImpl } from './psapp-util-impl';

export class PSAppDynaUtilImplBase
  extends PSAppUtilImpl
  implements IPSAppDynaUtilBase
{
  protected appidpsappdefield: IPSAppDEField;
  getAppIdPSAppDEField(): IPSAppDEField | null {
    if (this.appidpsappdefield != null) return this.appidpsappdefield;
    const value = this.M.getAppIdPSAppDEField;
    if (value == null) {
      return;
    }
    this.appidpsappdefield =
      this.getStoragePSAppDataEntity().findPSAppDEField(value);
    return this.appidpsappdefield;
  }

  protected createpsappdeaction: IPSAppDEAction;
  getCreatePSAppDEAction(): IPSAppDEAction | null {
    if (this.createpsappdeaction != null) return this.createpsappdeaction;
    const value = this.M.getCreatePSAppDEAction;
    if (value == null) {
      return;
    }
    this.createpsappdeaction =
      this.getStoragePSAppDataEntity().findPSAppDEAction(value);
    return this.createpsappdeaction;
  }

  protected getpsappdeaction: IPSAppDEAction;
  getGetPSAppDEAction(): IPSAppDEAction | null {
    if (this.getpsappdeaction != null) return this.getpsappdeaction;
    const value = this.M.getGetPSAppDEAction;
    if (value == null) {
      return;
    }
    this.getpsappdeaction =
      this.getStoragePSAppDataEntity().findPSAppDEAction(value);
    return this.getpsappdeaction;
  }

  protected modelidpsappdefield: IPSAppDEField;
  getModelIdPSAppDEField(): IPSAppDEField | null {
    if (this.modelidpsappdefield != null) return this.modelidpsappdefield;
    const value = this.M.getModelIdPSAppDEField;
    if (value == null) {
      return;
    }
    this.modelidpsappdefield =
      this.getStoragePSAppDataEntity().findPSAppDEField(value);
    return this.modelidpsappdefield;
  }

  protected modelpsappdefield: IPSAppDEField;
  getModelPSAppDEField(): IPSAppDEField | null {
    if (this.modelpsappdefield != null) return this.modelpsappdefield;
    const value = this.M.getModelPSAppDEField;
    if (value == null) {
      return;
    }
    this.modelpsappdefield =
      this.getStoragePSAppDataEntity().findPSAppDEField(value);
    return this.modelpsappdefield;
  }

  protected removepsappdeaction: IPSAppDEAction;
  getRemovePSAppDEAction(): IPSAppDEAction | null {
    if (this.removepsappdeaction != null) return this.removepsappdeaction;
    const value = this.M.getRemovePSAppDEAction;
    if (value == null) {
      return;
    }
    this.removepsappdeaction =
      this.getStoragePSAppDataEntity().findPSAppDEAction(value);
    return this.removepsappdeaction;
  }

  protected stoagepsappdataentity: IPSAppDataEntity;
  getStoagePSAppDataEntity(): IPSAppDataEntity | null {
    return (
      this.stoagepsappdataentity ||
      (this.stoagepsappdataentity = this.fillObjectModel(
        S._f,
        this.M.getStoagePSAppDataEntity,
        S._2cc,
      ) as IPSAppDataEntity)
    );
  }

  protected storagepsappdataentity: IPSAppDataEntity;
  getStoragePSAppDataEntity(): IPSAppDataEntity | null {
    return (
      this.storagepsappdataentity ||
      (this.storagepsappdataentity = this.fillObjectModel(
        S._f,
        this.M.getStoragePSAppDataEntity,
        S._39f,
      ) as IPSAppDataEntity)
    );
  }

  protected updatepsappdeaction: IPSAppDEAction;
  getUpdatePSAppDEAction(): IPSAppDEAction | null {
    if (this.updatepsappdeaction != null) return this.updatepsappdeaction;
    const value = this.M.getUpdatePSAppDEAction;
    if (value == null) {
      return;
    }
    this.updatepsappdeaction =
      this.getStoragePSAppDataEntity().findPSAppDEAction(value);
    return this.updatepsappdeaction;
  }

  protected useridpsappdefield: IPSAppDEField;
  getUserIdPSAppDEField(): IPSAppDEField | null {
    if (this.useridpsappdefield != null) return this.useridpsappdefield;
    const value = this.M.getUserIdPSAppDEField;
    if (value == null) {
      return;
    }
    this.useridpsappdefield =
      this.getStoragePSAppDataEntity().findPSAppDEField(value);
    return this.useridpsappdefield;
  }
  get cls(): string {
    return 'PSAppDynaUtilImplBase';
  }
  instanceof(cls: string): boolean {
    if (cls == S._16) return true;
    return super.instanceof(cls);
  }
}
